// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者，助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件，未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
import $i18n from '@/language/index'
export function modalSure(title) {
  return new Promise((resolve, reject) => {
    this.$confirm(
      ` ${title || $i18n.t('deletethisfile')}?`, $i18n.t('tips'), {
        confirmButtonText: this.$t('confirm'),
        cancelButtonText: $i18n.t('cancel'),
        type: 'warning'
      }).then(() => {
      resolve()
    }).catch(() => {
      this.$message({
        type: 'info',
        message: $i18n.t('canceled')
      })
    })
  })
}
export function modalSureDelete(title) {
  return new Promise((resolve, reject) => {
    this.$confirm(`${title || $i18n.t('tips33')}?`, $i18n.t('tips'), {
      confirmButtonText: $i18n.t('delete'),
      cancelButtonText: $i18n.t('donotdelete'),
      type: 'warning'
    }).then(() => {
      resolve()
    }).catch(action => {
      this.$message({
        type: 'info',
        message: $i18n.t('canceled')
      })
    })
  })
}
export function returnSure(title) {
  return new Promise((resolve, reject) => {
    this.$confirm(`${title || $i18n.t('deletethisfile')}?`, $i18n.t('tips'), {
      confirmButtonText: this.$t('confirm'),
      cancelButtonText: $i18n.t('cancel'),
      type: 'warning'
    }).then(() => {
      resolve()
    }).catch(() => {
      this.$message({
        type: 'info',
        message: $i18n.t('canceled')
      })
    })
  })
}
